package frame.options.virtualNetworks.create;

import java.awt.Dimension;
import java.awt.Point;
import java.util.List;

import javax.swing.ImageIcon;

import model.components.networks.network.VirtualNetwork;

import com.nexes.wizard.Wizard;

import frame.MopraFrame;

public class CreateVirtualNetworksWizard extends Wizard
{	
	private MopraFrame mopraFrame;
	public MopraFrame getFrame(){ return mopraFrame; }
	public void setFrame( MopraFrame mopraFrame ){ this.mopraFrame = mopraFrame; }
	
	private List< VirtualNetwork > virtualNetworks;
	public List< VirtualNetwork > getVirtualNetworks(){ return virtualNetworks; }
	public void setVirtualNetworks( List< VirtualNetwork > virtualNetworks ){ this.virtualNetworks = virtualNetworks; }
	
	public CreateVirtualNetworksWizard( MopraFrame mopraFrame )
	{
		this.setFrame( mopraFrame );
		
        this.getDialog().setTitle( "Create random virtual networks" );
        this.getDialog().setIconImage( ( new ImageIcon( this.getClass().getResource( "/icons/upcSmall.png" ) ) ).getImage() );
        this.registerWizardPanel( CreateVirtualNetworksSelectDescriptor.IDENTIFIER, new CreateVirtualNetworksSelectDescriptor() );
        this.registerWizardPanel( CreateVirtualNetworksFinishDescriptor.IDENTIFIER, new CreateVirtualNetworksFinishDescriptor() );
        this.setCurrentPanel( CreateVirtualNetworksSelectDescriptor.IDENTIFIER );
        
        Point topLeft = this.getFrame().getNetworksPanel().getLocationOnScreen();
		Dimension size = this.getFrame().getNetworksPanel().getSize();
		Dimension preferredSize = this.getDialog().getPreferredSize();
		this.getDialog().setLocation( topLeft.x + ( size.width / 2 ) - ( preferredSize.width / 2 ), topLeft.y + ( size.height / 2 ) - ( preferredSize.height / 2 ) );
	}
	
}
